//
//  WebGetData.m
//  Match
//
//  Created by lanou3g on 15/6/1.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "WebGetData.h"
#import "AFHTTPRequestOperationManager.h"
#import "UIImageView+WebCache.h"
@implementation WebGetData
#pragma ---MatchVC---调用加载数据方法
+ (void)getStringWithUrlString:(NSString *)urlString success:(void (^)(NSString *content))success{
    
    AFHTTPRequestOperationManager *manager= [AFHTTPRequestOperationManager manager];
   
    [manager GET:urlString parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        
        NSDictionary * responseDic = responseObject;
        
        NSString *content = [[responseDic objectForKey:@"result"] objectForKey:@"content"];
        
        success(content);
        
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
    }];
    
    
    
}


+ (void)setMatchView:(MatchVC *)match withModel:(NewsModel *)newsModel{
    
    if ([newsModel.statusId isEqualToString:@"1"]) {
        
        match.leftLabel.hidden = YES;
        match.rightLabel.hidden = YES;
    }
    match.leftLabel.text= newsModel.home_score;
    match.rightLabel.text = newsModel.away_score;
    match.leftBottomL.text = newsModel.home_name;
    match.rightBottomL.text = newsModel.away_name;
    match.centerLabel.text = newsModel.desc;
    
    [match.homeImageV sd_setImageWithURL:[NSURL URLWithString:newsModel.home_logo] placeholderImage:[UIImage imageNamed:@"placeHold"]];
    [match.awayImageV sd_setImageWithURL:[NSURL URLWithString:newsModel.away_logo] placeholderImage:[UIImage imageNamed:@"placeHold"]];

}




@end
